﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ferreteria.Forms.GestionPedidos
{
    public partial class FrmIncrementoX : Form
    {
        int Pedid;
        bool bandera;
        decimal inc;

        public FrmIncrementoX()
        {
            InitializeComponent();
        }

        public FrmIncrementoX(int idpedsel)
        {
            InitializeComponent();
            Pedid = idpedsel;
            bttnAceptar.Select();
            bandera = true;
        }

        private void bttnAceptar_Click(object sender, EventArgs e)
        {
            if (bandera == true)
            {
                inc = NumUpInc.Value;
                this.Close();
                FrmEmitirComprobanteX EmitirCompX = new FrmEmitirComprobanteX(Pedid, inc);
                EmitirCompX.ShowDialog();
            }
            else
            {
                //inc = NumUpInc.Value;
                //this.Close();
                //frmEmitirFactura EmitirFact = new frmEmitirFactura(inc);
                //EmitirFact.ShowDialog();
            }
        }

        private void NumUpInc_ValueChanged_1(object sender, EventArgs e)
        {

            bttnAceptar.Select();
        }

        private void bttnCancelar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    
    }
}
